""" 自定义异常类 """
from enum import Enum


class CustomException(Exception):
    def __init__(self, status_code: int, detail: str, data: str = None):
        self.status_code = status_code
        self.detail = detail
        self.data = data


UPLOAD = CustomException(1001, "文件上传失败")
LIST = CustomException(1002, "查询文件失败")
UPDATE = CustomException(1003, "修改文件名失败")
EXPIRED = CustomException(1004, "文件名已过期")
DELETE = CustomException(1005, "删除失败")
